package com.iiiss.gae.impl.entities;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.iiiss.gae.core.entities.ColumnGae;
import com.iiiss.gae.impl.entities.BaseEntityImpl;
import com.iiiss.ssh.core.entities.Column;

@Entity(name = Column.ENTITY_NAME)
public class ColumnGaeImpl extends BaseEntityImpl implements ColumnGae {

	@Basic
	private String name;

	@Transient
	private Column parent;

	@Basic
	private Long parentId;

	@Transient
	private List<Column> children = new ArrayList<Column>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Column getParent() {
		return parent;
	}

	public void setParent(Column parent) {
		this.parent = parent;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public List<Column> getChildren() {
		return children;
	}

	public void setChildren(List<Column> children) {
		this.children = children;
	}

	public String toString() {
		return "{ Column " + getId() + " : " + getName() + ", " + getChildren() + " }";
	}

}
